<!DOCTYPE html>
<html class="ui-page-login">

	<head>
		<meta charset="utf-8">
	    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	    <title>商城</title>
	    <meta name="Keywords" content=""/>
	    <meta name="description" content="" />
		<script src="__ROOT__/static/home/css/userInfo/js/mui.min.js"></script>
		<link href="__ROOT__/static/home/css/userInfo/css/mui.min.css" rel="stylesheet"/>
		<link href="__ROOT__/static/home/css/login.css" rel="stylesheet"/>
		<link rel="stylesheet" href="__ROOT__//static/home/css/userInfo/css/style.css"/>
		<link href="__ROOT__/static/plugins/layer/skin/layer.css" rel="stylesheet" />
		<script src="__ROOT__/static/home/js/jquery-1.11.1.min.js"></script>
		<script src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/layer.js"></script>
		<script src="__ROOT__/static/plugins/layer.mobile-v2.0/layer_mobile/need/layer.css"></script>
	    <script type="text/javascript"> 
	        !function(J){function H(){var d=E.getBoundingClientRect().width;var e=(d/7.5>100*B?100*B:(d/7.5<42?42:d/7.5));E.style.fontSize=e+"px",J.rem=e}var G,F=J.document,E=F.documentElement,D=F.querySelector('meta[name="viewport"]'),B=0,A=0;if(D){var y=D.getAttribute("content").match(/initial\-scale=([\d\.]+)/);y&&(A=parseFloat(y[1]),B=parseInt(1/A))}if(!B&&!A){var u=(J.navigator.appVersion.match(/android/gi),J.navigator.appVersion.match(/iphone/gi)),t=J.devicePixelRatio;B=u?t>=3&&(!B||B>=3)?3:t>=2&&(!B||B>=2)?2:1:1,A=1/B}if(E.setAttribute("data-dpr",B),!D){if(D=F.createElement("meta"),D.setAttribute("name","viewport"),D.setAttribute("content","initial-scale="+A+", maximum-scale="+A+", minimum-scale="+A+", user-scalable=no"),E.firstElementChild){E.firstElementChild.appendChild(D)}else{var s=F.createElement("div");s.appendChild(D),F.write(s.innerHTML)}}J.addEventListener("resize",function(){clearTimeout(G),G=setTimeout(H,300)},!1),J.addEventListener("pageshow",function(b){b.persisted&&(clearTimeout(G),G=setTimeout(H,300))},!1),H()}(window);
	        if (typeof(M) == 'undefined' || !M){
	            window.M = {};
	        }
	    </script>
		<style>
			.mui-btn-blue, .mui-btn-primary, input[type=submit]{ background: #f23030; border: 0;}
			.area {
				margin: 20px auto 0px auto;
			}
			.mui-input-group:first-child {
				margin-top: 20px;
			}
			.mui-input-group label {
				width: 22%;
			}
			.mui-input-row label~input,
			.mui-input-row label~select,
			.mui-input-row label~textarea {
				width: 78%;
			}
			.mui-checkbox input[type=checkbox],
			.mui-radio input[type=radio] {
				top: 6px;
			}
			.mui-content-padded {
				margin-top: 25px;
			}
			.mui-btn {
				padding: 10px;
			}
			
		</style>
	</head>
	<script>
        $(document).ready(function(){
            $("#back").click(function(){
                var back ={};
                back.userName = $.trim($("#username").val());
                back.email = $.trim($("#email").val());
                back.phone = $.trim($("#phone").val());
                $.ajax({
                    cache:true,
                    type:"POST",
                    url:"{:url('home/Login/backLogin')}",
                    dataTypes:"text",
                    data:back,
                    async:false,
                    success:function(data){
                        if(data==1){
                            layer.open({
                                content: '账号或者手机未输入'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }else if(data==2){
                            layer.open({
                                content: '错误的手机号码'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }else if(data==3){
                            layer.open({
                                content: '账号输入错误'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }else if(data==4){
                            layer.open({
                                content: '验证成功，即将跳转到修改密码页面'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                            setTimeout("window.location.href='{:url('home/Userinfo/updatePassword')}'",1000);
                        }
					}
				})
        })
        })
	</script>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">忘记密码</h1>
		</header>
		<div class="mui-content">
			<form class="mui-input-group">
				<div class="mui-input-row">
					<label>账号</label>
					<input id='username' type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
				</div>
				<div class="mui-input-row">
					<label>手机号</label>
					<input id='phone' type="text" class="mui-input-clear mui-input" placeholder="请输入手机号">
				</div>
			</form>
			<div class="mui-content-padded">
				<button id='back' class="mui-btn mui-btn-block mui-btn-primary" >找回密码</button>
			</div>
			<div class="mui-content-padded">
				<center><p>找回密码需要验证你的手机号码和邮箱，全部验证成功可重新设置密码</p></center>
			</div>
		</div>

	</body>
	<script>
        $(document).ready(function(){
            $("#username").mouseout(function(){
                var username=$.trim($("#username").val());
                if(!username){
                    layer.open({
                        content: '用户账号不能为空'
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                }
            })
                 $("#phone").mouseout(function(){
                        var phone=$.trim($("#phone").val());
                        if(!phone){
                            layer.open({
                                content: '请输入手机号'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }else if(!(/^1[34578]\d{9}$/.test(phone))){
                            layer.open({
                                content: '手机号码格式错误'
                                ,skin: 'msg'
                                ,time: 2 //2秒后自动关闭
                            });
                        }
                 })
		})
	</script>
</html>